//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class ChartsheetProtection: IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        const string xmlName = "sheetProtection";
        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read(xmlName))
            {
                Password = c.GetOptionalString("password");
                Content = c.GetOptionalBoolean("content", false);
                Objects = c.GetOptionalBoolean("objects", false);
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write(xmlName))
            {
                c.SetOptionalString("password", Password);
                c.SetOptionalBoolean("content", Content, false);
                c.SetOptionalBoolean("objects", Objects, false);
            }
        }

        #endregion

        private string _password;

        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }
        private bool _content;

        public bool Content
        {
            get { return _content; }
            set { _content = value; }
        }
        private bool _objects;

        public bool Objects
        {
            get { return _objects; }
            set { _objects = value; }
        }
	
	
    }
}
